#include "stdafx.h"
#include "Time.h"

Time::Time()
{
	currentTime = NULL;
	elapsedTime = 0.0f;

	fpsTime = 0.0f;
	frames = 0;
	fps	= 60;
}

Time::~Time()
{
}

void Time::Initialize(void)
{
	currentTime = GetTickCount();
}

void Time::Update(void)
{
	DWORD time = GetTickCount();
	elapsedTime = (time - currentTime) / 1000.0f;
	currentTime = time;

	fpsTime += elapsedTime;
	fpsTime++;
	if (fpsTime >= 1.0f)
	{
		fpsTime -= 1.0f;
		fps = frames;
		fpsTime = 0;
	}
}
